import ko from 'knockout'
// import ycloud from 'ycloud'
import template from './index.html'
import BaseView from '@/base/baseview'
// import u from 'u'

class View extends BaseView {
  data () {
    this.columns1 = ko.observableArray([
      {
        title: 'id',
        field: 'id',
        rowspan: 2,
        type: 'checkbox'
      }, {
        title: '序号',
        field: 'id',
        rowspan: 2,
        type: 'index',
        width: '80'
      }, {
        title: '供应商名称',
        field: 'name',
        rowspan: 2,
        width: 200
      }, {
        title: '报价信息',
        colspan: 3,
        width: 200,
        align: 'center'
      }, {
        title: '联系方式',
        field: 'cell',
        width: 150,
        rowspan: 2
      }
    ])
    this.columns2 = ko.observableArray([
      {
        title: '单价',
        field: 'price'
      }, {
        title: '数量',
        field: 'num'
      }, {
        title: '税率',
        field: 'tax'
      }
    ])
    this.complexHeadRows = ko.observableArray([
      {
        id: 1,
        name: '北京供应商',
        cell: '18182736212',
        price: 100.00,
        num: 12,
        tax: '17%'
      }, {
        id: 2,
        name: '上海供应商',
        cell: '18182736212',
        price: 120.00,
        num: 12,
        tax: '13%'
      }, {
        id: 3,
        name: '天津供应商',
        cell: '18182736212',
        price: 115.00,
        num: 12,
        tax: '13%'
      }, {
        id: 4,
        name: '四川供应商',
        cell: '18182736212',
        price: 98.00,
        num: 12,
        tax: '17%'
      }, {
        id: 5,
        name: '山东供应商',
        cell: '18182736542',
        price: 97.00,
        num: 16,
        tax: '15%'
      }, {
        id: 6,
        name: '陕西供应商',
        cell: '18182736256',
        price: 95.00,
        num: 18,
        tax: '14.5%'
      }, {
        id: 7,
        name: '贵州供应商',
        cell: '18182736287',
        price: 108.00,
        num: 10,
        tax: '19%'
      }, {
        id: 8,
        name: '浙江供应商',
        cell: '18182736299',
        price: 107.00,
        num: 45,
        tax: '16.5%'
      }, {
        id: 9,
        name: '湖北供应商',
        cell: '18182736243',
        price: 91.00,
        num: 15,
        tax: '18.5%'
      }, {
        id: 10,
        name: '海南供应商',
        cell: '18182736245',
        price: 104.00,
        num: 12,
        tax: '17%'
      }, {
        id: 11,
        name: '辽宁供应商',
        cell: '18182731112',
        price: 94.00,
        num: 12,
        tax: '16%'
      }
    ])
  }
}

export default {
  template,
  View
}
